/*
 * @Date: 2022-04-27 15:52:20
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-04-28 11:57:20
 * @FilePath: \Vue3-ts-cms\src\hooks\userPermissionHook.ts
 * @description: 文件描述
 */
import { useStore } from 'vuex'

export function userPermissionHook(
  pageName?: string,
  handleName?: string
): any {
  const store = useStore()
  const permissionList = store.state.loginModule.permissions
  const needPermission = `system:${pageName}:${handleName}`
  return !!permissionList.find((item: any) => item === needPermission)
}
